package com.exp.service;

import com.exp.dao.NewsMapper;
import com.exp.dao.more.MoreNewsMapper;
import com.exp.model.News;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 Created by guojianyu on 2016/1/24.
 */
@Service
@Transactional
public class NewsService {
 @Autowired
 private MoreNewsMapper moreNewsMapper;
 @Autowired
 private NewsMapper newsMapper;
 public List<News> getList(Map<String, Object> params) {
  return moreNewsMapper.getList(params);
 }
 public int delete(Integer id){
  return newsMapper.deleteByPrimaryKey(id);
 }
 public int add(News news){
  return  newsMapper.insertSelective(news);
 }
 public int update(News news){
  return  newsMapper.updateByPrimaryKeySelective(news);
 }
}
